package com.lyb.lmvp.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.ActivityOptionsCompat;

import com.lyb.mvp.core.LActivity;
import com.lyb.mvp.router.Router;

/**
 * Created by lyb on 2017/7/27.
 * Email: 1373519715@qq.com
 * Blog: https://littleiii.github.io
 */

public class BActivity extends LActivity<PMulti> implements ICommonV {
    @Override
    public void initData(Bundle savedInstanceState) {
        getP().loadData();
    }

    @Override
    public int getLayoutId() {
        return 0;
    }

    @Override
    public PMulti newP() {
        return new PMulti();
    }


    @Override
    public void showError(Exception e) {

    }

    @Override
    public void showOk() {
        Router.newIntent(context)
                .to(EndActivity.class)
                .putString("arg_name", "xdroid")
                .launch();

        Router.newIntent(context)
                .to(EndActivity.class)
                .putString("arg_name", "xdroid")
                .requestCode(100)
                .launch();

        int exitAnim = 0, enterAnim = 0;
        Router.newIntent(context)
                .to(EndActivity.class)
                .putString("arg_name", "xdroid")
                .anim(enterAnim, exitAnim)
                .launch();

        Router.newIntent(context)
                .to(EndActivity.class)
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                .launch();

        Router.newIntent(context)
                .to(EndActivity.class)
                .options(ActivityOptionsCompat.makeBasic())
                .launch();

    }
}